package ModelLayer;

import DBLayer.MapName;

/**
 *
 * @author Evil
 */
public class OrderLine
{
    private Order order;
    private Product product;
    @MapName(ColumnName = "Quantity")
    private int quantity;
    @MapName(ColumnName = "ProductID")
    private int productID;
    @MapName(ColumnName = "OrderID")
    private int orderID;

    public OrderLine(Product product, int quantity)
    {
        this.product = product;
        this.quantity = quantity;
    }

    public OrderLine()
    {
    }

    /**
     * Get the value of order
     *
     * @return the value of order
     */
    public Order getOrder()
    {
        return order;
    }

    /**
     * Set the value of order
     *
     * @param order new value of order
     */
    public void setOrder(Order order)
    {
        this.order = order;
    }

    /**
     * Get the value of orderID
     *
     * @return the value of orderID
     */
    public int getOrderID()
    {
        return orderID;
    }

    /**
     * Set the value of orderID
     *
     * @param orderID new value of orderID
     */
    public void setOrderID(int orderID)
    {
        this.orderID = orderID;
    }

    /**
     * Get the value of productID
     *
     * @return the value of productID
     */
    public int getProductID()
    {
        return productID;
    }

    /**
     * Set the value of productID
     *
     * @param productID new value of productID
     */
    public void setProductID(int productID)
    {
        this.productID = productID;
    }

    /**
     * Get the value of quantity
     *
     * @return the value of quantity
     */
    public int getQuantity()
    {
        return quantity;
    }

    /**
     * Set the value of quantity
     *
     * @param quantity new value of quantity
     */
    public void setQuantity(int quantity)
    {
        this.quantity = quantity;
    }

    /**
     * Get the value of product
     *
     * @return the value of product
     */
    public Product getProduct()
    {
        return product;
    }

    /**
     * Set the value of product
     *
     * @param product new value of product
     */
    public void setProduct(Product product)
    {
        if (product != null)
        {
            this.product = product;
            this.productID = product.getProductID();
        }
    }
}
